package com.ljsw.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.ljsw.activity.MainActivity;
import com.ljsw.activity.R;
import com.ljsw.activity.VersionCheckActivity;
import com.ljsw.util.Skip;

/**
 * 关于Fragment
 * 作者: 石锚
 * 版本: 1.0
 * 日期: 2015-10-16
 */
public class GyFragment extends BaseFragment implements OnClickListener{
	private View view;
	private ImageView image;//版本升级
	private TextView back;
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		view = inflater.inflate(R.layout.fragment_guanyu, container, false);
		initView();
		return view;
	}
	/**
	 * 初始化控件
	 */
	public void initView(){
		back = (TextView) getActivity().findViewById(R.id.back);
		image = (ImageView) view.findViewById(R.id.imagesj);
		image.setOnClickListener(this);
		back.setOnClickListener(this);
//		back.setText("退出");原版本
		back.setText("返回");
	}
	public void onClick(View arg0) {
		switch (arg0.getId()) {
		case R.id.imagesj:
			Skip.skip(getActivity(), VersionCheckActivity.class, null, 0);
			break;

		case R.id.back:
			if(getActivity()!=null){
				getActivity().onBackPressed();
			}
			break;
		}
	}
}
